﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Avanade.ViddlerDotNet
{
    public class Settings : ConfigurationSection
    {
        private const string SectionName = "viddlerNetSettings";
        private static Settings settings = (Settings)System.Configuration.ConfigurationManager.GetSection(Settings.SectionName);

        public Settings()
        {
        }

        private static string _apiKey = string.Empty ;
        // <summary>
        //API key
        // </summary>
        public static string apiKey
        {
            get { return _apiKey; }
            set { _apiKey = value; }
        }

        public static Settings CurrentSettings
        {
            get
            {
                return settings;
            }
        }

        [ConfigurationProperty("apiKey", DefaultValue = "0123456789abcdef0123456789abcdef0123", IsRequired = true)]
        public String ApiKey
        {
            get
            { return (String)this["apiKey"]; }
            set
            { this["apiKey"] = value; }
        }

        [ConfigurationProperty("baseUrl", DefaultValue = "http://www.viddler.com/rest/v1/?method={0}&api_key={1}", IsRequired = true)]
        public String BaseUrl
        {
            get
            { return (String)this["baseUrl"]; }
            set
            { this["baseUrl"] = value; }
        }
    }
}
